﻿namespace WebService.Logger
{
    public class AJLog4Logger
    {
        private ILogger _logger;

        public AJLog4Logger()
        {

        }

        public void CreateLogger(ILoggerProvider loggerProvider)
        {
            _logger = loggerProvider.CreateLogger(nameof(AJLog4Logger));
        }

        public void Info(string message, Exception ex = null)
        {
            _logger.Log(LogLevel.Information, ex, message);
        }

        public void Error(string message, Exception ex = null)
        {
            _logger.Log(LogLevel.Error, ex, message);
        }

        public void Debug(string message)
        {
            _logger.Log(LogLevel.Debug, message);
        }

        public void Warning(string message)
        {
            _logger.Log(LogLevel.Warning, message);
        }
    }
}
